<?php

/**
 * This file is part of the Pagizer package.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @copyright   Copyright (c) 2010 Advisa (http://www.advisa.fr)
 * @author      Pagizer Core Team <team@pagizer.org>
 * @package     pagizer
 * @subpackage  backoffice
 */

function smarty_modifier_fullname($string)
{
    $user =  f_document_Loader::getInstance('modules_users/user')->whereIsEqual('login', $string)->retrieveFirstDocument();

    if(is_object($user))
    {
        $name = $user->getFirstname().' '.$user->getLastname();

        if($name != '')
        {
            return $name;
        }
    }

    return $string;
}